package cn.imvc.app.models;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;

import cn.imvc.app.entities.Bankcard;
import cn.imvc.app.repositories.BankcardRepository;
import cn.imvc.app.repositories.MemberRepository;
import cn.imvc.data.domain.ViewRequest;

@Service
public class BankcardModelImpl implements BankcardModel{
	@Autowired
	private BankcardRepository bankcardRepository;
	
	public Page<Bankcard> findByMemberId(ViewRequest viewRequest,int memberId) {
		if(viewRequest == null){
			viewRequest = new ViewRequest();
		}
		viewRequest.getParams().put("b_dot_member_dot_id_eq_number", ""+memberId);
		return bankcardRepository.findAll("b","Bankcard b",viewRequest);
	}


}
